package com.example.reagent_management.ui.activity.data;

import android.annotation.SuppressLint;

import com.example.reagent_management.R;
import com.example.reagent_management.ui.home.pojo.OperateCounts;
import com.kunminx.architecture.ui.callback.UnPeekLiveData;

import java.util.ArrayList;
import java.util.List;

public class DataRepository {
    private static final DataRepository data = new DataRepository();

    private DataRepository() {
    }

    public static DataRepository getInstance()  {
        return data;
    }

    //初始化 位置卡片数据
//    public void requestList(UnPeekLiveData<List<PositionCounts>> liveData){
//        ArrayList<PositionCounts> list = new ArrayList<>();
//        int apposition = MMKVUtils.getHelper().decodeInt("APPOSITION");
//        for (int i = 0; i < apposition; i++) {
//            list.add(new PositionCounts(i+1,0));
//        }
//        liveData.setValue(list);
//    }

    @SuppressLint("ResourceType")
    public void requestList(UnPeekLiveData<List<OperateCounts>> liveData){
        ArrayList<OperateCounts> list = new ArrayList<>();
//        int apposition = MMKVUtils.getHelper().decodeInt("APPOSITION");
//        for (int i = 0; i < 3; i++) {
            list.add(new OperateCounts(R.drawable.instock,"入库"));
            list.add(new OperateCounts(R.drawable.outstock,"出库"));
            list.add(new OperateCounts(R.drawable.store2,"试剂\n管理"));
//        }
        liveData.setValue(list);
    }

}
